import { Controller, Get, Post, Body, Patch, Param, Delete } from '@nestjs/common';
import { HomeDataService } from './home-data.service';
import { CreateHomeDatumDto } from './dto/create-home-datum.dto';
import { UpdateHomeDatumDto } from './dto/update-home-datum.dto';

@Controller('home-data')
export class HomeDataController {
  constructor(private readonly homeDataService: HomeDataService) { }

  @Post()
  create(@Body() createHomeDatumDto: CreateHomeDatumDto) {
    return this.homeDataService.create(createHomeDatumDto);
  }

  @Get('/data')
  findAll() {
    return this.homeDataService.findAll();
  }

  @Get(':id')
  findOne(@Param('id') id: string) {
    return this.homeDataService.findOne(+id);
  }

  @Patch(':id')
  update(@Param('id') id: string, @Body() updateHomeDatumDto: UpdateHomeDatumDto) {
    return this.homeDataService.update(+id, updateHomeDatumDto);
  }

  @Delete(':id')
  remove(@Param('id') id: string) {
    return this.homeDataService.remove(+id);
  }
}
